package com.ark.frigate.spring.envet;

import org.springframework.context.ApplicationEvent;

/**
 * @author zengweilong
 * @date 4/11/21 4:31 PM
 */
public class MessageEvent<T> extends ApplicationEvent {

    /**
     * 处理Bean
     */
    private final T entity;

    /**
     * Create a new {@code ApplicationEvent}.
     *
     * @param source the object on which the event initially occurred or with
     *               which the event is associated (never {@code null})
     */
    public MessageEvent(Object source, T entity) {
        super(source);
        this.entity = entity;
    }

    public T getEntity() {
        return entity;
    }
}
